<?php
/**
 * Lista os Campi cadastrados no banco de dados.
*/

if(!isset($_SESSION))
{
   session_start();
}

if( !function_exists('__autoload') )
{
    function __autoload($class_name) {
    require_once $class_name . '.php';
    }
}

SAEO::ValidarAcesso( array( 0, 2 ) );

// Descri��es da Ajuda
$ajudaCampus = 'showhint("Escolha o campus que deseja alterar.", this, event, "220px");';
$ajudaNome = 'showhint("Nome da Campus.", this, event, "220px");';
$ajudaResponsavel = 'showhint("Respons�vel pela Campus.", this, event, "220px");';

$campus = new Campus();
$campiCadastradas = $campus->CarregarCampi();
echo"<html>
           <!DOCTYPE html PUBLIC '-//W3C//DTD XHTML 1.0 Strict//EN' 'http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd'>
           <html xmlns='http://www.w3.org/1999/xhtml' xml:lang='en' lang='en'>
           <meta http-equiv='Content-Type' content='text/html; charset=utf-8' />
           <head>
           <title>SAEO - Listar Unidades</title>
           <script type='text/javascript' src='templates/hintbox.js'></script>
           <script type='text/javascript' src='templates/js.js'></script>
           <script type='text/javascript' src='templates/ajax.js'></script>
           <script type='text/javascript' src='templates/validacoes.js'></script>
           <script type='text/javascript' src='templates/campus.js'></script>
           <script type='text/javascript' src='templates/geral.js'></script>
           <link rel='stylesheet' type='text/css' href='templates/estilos.css'/>

           </head>
     <body class='body'>
     <form name='listar_campi' method='post'>
     <table width='779' border='0' cellspacing='0' cellpadding='0' align='center' bgcolor='#FFFFFF'>
            <tr>
                <td>";
                include "Topo.php";
                echo"</td>
            </tr>
            <tr>
                <td><div class='titulosTabelas' style='width:779; height:20; background:url(templates/tabela.jpg)'>LISTAR UNIDADES</div></td>
            </tr>
            <tr>
                <td>&nbsp;</td>
            </tr>
            <tr>
                <td><table id='dadosFuncionario' width='650' border='0' cellpadding='0' align='center' bgcolor='#FFFFFF' class='detalhamento'>
                           <thead class='detalhamento'>
                                  <tr>
                                      <th>Nome</th>
                                      <th>Respons&aacute;vel</th>
                                  </tr>
                           </thead>
                           <tbody class='detalhamento' id='corpoFuncionario'>";
                           for( $i = 0; $i < count( $campiCadastradas ) ; $i++ ){
                           echo"
                                  <tr>
                                      <td style='text-align:center'>".$campiCadastradas[$i]->nome."</td>
                                      <td style='text-align:center'>".$campiCadastradas[$i]->responsavel."</td>
                                  </tr>
                           ";
                           }
                           echo"
                           </tbody>
                    </table>
                </td>
            </tr>
            <tr>
                <td>&nbsp;</td>
            </tr>
            <tfoot>
                   <tr>";
                       include 'rodapeCreditos.php';
            echo"
            </tr>
            </tfoot>
     </table>
     </form>
     </body>
     </html>
     ";
?>
